package tests;

import static org.junit.Assert.*;

import org.junit.Test;

import src.RecursiveSearch;

public class RecursiveSearchTest {
	
	@Test
	public void testRecusiveSearchConstructor(){
		new RecursiveSearch();
	}
	
	@Test
	public void testRecursiveSearch(){
		
		int h = RecursiveSearch.recursiveSearch(new int[] {1,2,3,4,5,6,7,8,9,10}, 10, 0, 3);
		assertEquals(h, -11);
		
		int i = RecursiveSearch.recursiveSearch(new int[] {1,2,3,4,5,6,7,8,9,10}, 0, 10, 3);
		assertEquals(i, 2);
		
		int j = RecursiveSearch.recursiveSearch(new int[] {1,2,3,4,5,6,7,8,9,10}, 0, 10, 5);
		assertEquals(j, 4);
		
		int k = RecursiveSearch.recursiveSearch(new int[] {1,2,3,4,5,6,7,8,9,10}, 0, 10, 9);
		assertEquals(k, 8);
	}

}
